<template>
	<view class="main">
		<topCommonTitleBar class="topBar" :statePerchHeight="'var(--status-bar-height)'" arrow="white" :title="navTitle"
			actionUIcon="search" @actionClick="goSearch" />
		<view class="tabs">
			<view class="tab_flex">
				<u-tabs :list="tabList" @click="tabs" :current="activeIndex" scrollable lineColor="#4291FF"
					:activeStyle="activeStyle" :inactiveStyle="inactiveStyle" :itemStyle="itemStyle">
				</u-tabs>
				<view class="tabs_shadow"></view>
			</view>

			<swiper class="content flex1" :duration="350" :current="activeIndex" @transition="transition"
				@animationfinish="animationfinish" @change="swiperChange">
				<swiper-item v-for="(item, index) in tabList" :key="index" class="swiper_item flex_col">
					<scroll-view class="scroll_page flex1" :refresher-threshold="120" :refresher-enabled="scrollY"
						:refresher-triggered="item.triggered" scroll-y="true" @refresherrefresh="refresherrefresh"
						@scrolltolower="scrolltolower">
						<template v-if="item.dataList && item.dataList.length > 0">
							<view v-for="(itm, idx) in item.dataList" :key="idx" class="tabList">
								<view class="tabItem" @click="goDetails(itm)">
									<view class="left">
										<view class="topTitle">
											{{ itm.title }}
										</view>
										<view class="bottomTime">
											<view class="time">
												{{ itm.push_date }}
											</view>
											<view class="read">
												{{ parseInt(itm.records) > 9999 ? itm.records.slice(0, itm.records.length - 4) + 'W阅读' :
													itm.records + '阅读' }}
											</view>
										</view>
									</view>
									<image v-if="itm.pic" class="imgZu" :showLoading="true" :src="itm.pic"
										style="width: 244rpx;height: 168rpx;" mode="aspectFill">
									</image>
								</view>
							</view>
							<view style="padding: 20rpx 0;padding-bottom: 30rpx;">
								<u-loadmore marginTop='0' marginBottom='0' :status="status" :line="true" />
							</view>
						</template>
						<view class="bgCon" v-else>
							<view style="padding: 20rpx 0;padding-bottom: 30rpx;">
								<u-loadmore marginTop='0' color="#999" marginBottom='0' status="nomore" :line="true" />
							</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>

		</view>
	</view>
</template>


<script type="text/javascript" src="plus-confusion://../consult/index"></script>

<style lang="scss" scoped>
.main {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	background-color: #ffffff;

	.topBar {
		background-image: linear-gradient(to right, #7FBDFF, #3497FF) !important;
	}

	.tabs {
		font-family: Source Han Sans CN-Bold, Source Han Sans CN;
		font-weight: bold;

		.tab_flex {
			position: relative;
			padding-right: 40rpx;

			.tabs_shadow {
				position: absolute;
				right: 0;
				top: 0;
				height: 96rpx;
				width: 90rpx;
				background-image: linear-gradient(to right, rgba(0, 0, 0, 0), #fff, #fff);
			}
		}
	}


	.content {
		width: 100%;
		flex: 1;
		position: relative;
		height: 100%;
		height: calc(100vh - 178rpx - 66rpx);
		overflow: auto;

		.swiper_item {
			position: relative;
			height: 100%;
		}

		.scroll_page {
			position: relative;
			height: calc(100vh - 178rpx - 66rpx);
			overflow: hidden;

			.tabList {

				.tabItem {
					display: flex;
					padding: 40rpx;

					.left {
						flex: 1;

						.topTitle {
							font-size: 32rpx;
							font-weight: 500;
							color: #333333;
							line-height: 40rpx;
							height: 120rpx;
							padding-right: 16rpx;
							word-break: break-all;
							text-overflow: ellipsis;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 3;
							overflow: hidden;
						}

						.bottomTime {
							height: 44rpx;
							line-height: 24rpx;
							display: flex;
							align-items: flex-end;
							font-size: 24rpx;
							color: #999999;
							font-weight: 400;

							.read {
								margin-left: 48rpx;
							}
						}

					}

					.imgZu {
						width: 244rpx;
						height: 168rpx;
						border-radius: 10rpx;
						overflow: hidden;
						background-color: #f3f4f6;
					}

				}
			}
		}
	}
}

.bgCon {
	font-size: 24rpx;
}


.u-navbar {
	margin-top: 70px;
	background-color: #4291FF;
}

.u-navbar__content {
	height: 185px;
	background-color: #4291FF;
}


::v-deep.u-popup__content {
	width: 85% !important;
	height: 100% !important;
	margin-left: 15% !important;
}

::v-deep .uni-scroll-view-refresh__spinner>circle {
	color: #2979ff !important;
}

::v-deep .uni-scroll-view-refresh-inner>svg {
	fill: #2979ff !important;
}

::v-deep .u-line-1 {
	font-weight: 400;
}
</style>
